/*
 * FeaturePoint.h
 *
 *  Created on: Apr 14, 2009
 *      Author: wrice
 */

#ifndef FEATUREPOINT_H_
#define FEATUREPOINT_H_
#include "MyVideoTrace.h"
namespace MyVideoTrace {

class FeaturePoint {
public:
	typedef map< FrameNumber, Point2D > Points2DType;
	typedef Points2DType::const_iterator Points2DIterator;

	FeaturePoint(int id);

	size_t sizePoint2D() const;
	Points2DIterator beginPoint2D();
	Points2DIterator endPoint2D();
	Points2DIterator findPoint2D(FrameNumber whichFrame);
	void setPoint2D(FrameNumber whichFrame, Point2D point2d);
	void removePoint2D(FrameNumber whichFrame);

	int getFeaturePointID() const;

	Vector3f getPoint3D() const;
	void setPoint3D( Vector3f aValue );
	void setPoint3D( float x, float y, float z );
	float getX() const;
	float getY() const;
	float getZ() const;

	friend ostream &operator<<(ostream &stream, FeaturePoint rhs);

	class Comparator {
	public:
		inline bool operator() ( const FeaturePoint * & lhs, const FeaturePoint * & rhs ) const {
			return lhs->getFeaturePointID() < rhs->getFeaturePointID();
		}
		inline bool operator() ( const FeaturePointPtr & lhs, const FeaturePointPtr & rhs ) const {
			return lhs->getFeaturePointID() < rhs->getFeaturePointID();
		}
	};

private:
	Points2DType points2d_;
	int fpointId_;
	float x_, y_, z_;

public: virtual ~FeaturePoint() {}
};

}

#endif /* FEATUREPOINT_H_ */
